<!DOCTYPE html>

<html lang="zh-Hans">
  <head>
    <meta charset="utf-8" />
    <meta name="author" content="rogepi" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script src="/vue.global.js"></script>
    <title>2-blog-post</title>
  </head>

  <body>
    <div id="blog-post-demo">
      <blog-post title="My journey with Vue"></blog-post>
      <blog-post title="Blogging with Vue"></blog-post>
      <blog-post title="Why Vue is so fun"></blog-post>
    </div>
    <script>
      const app = Vue.createApp({});

      app.component('blog-post', {
        // 通过 Prop 向子组件传递数据
        props: ['title'],
        template: `<h4>{{title}}</h4>`,
      });

      app.mount('#blog-post-demo');
    </script>
  </body>
</html>
